package com.example.demo.study.thread;

public class ThreadService {
    public static void main(String[] args) throws InterruptedException {
        Thread a =new Thread(new Runnable() {
            @Override
            public void run() {
                for(int i=0;i<100;i++)
                {
                    try {
                        Thread.sleep(1000);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                    System.out.println(Thread.currentThread().getName()+"调用了"+i+"次");
                }

            }
        });
        a.start();



        for(int i=0;i<100;i++)
        {
            Thread.sleep(1000);
            System.out.println(Thread.currentThread().getName()+"调用了"+i+"次");
        }
    }
}
